﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 mc:Ignorable="d" x:Name="userControl" 
			 x:Class="CustomControls.CircularButton.CircularCloseButtonControl" Width="58" Height="58"
             >
    <UserControl.Resources>
        <Style x:Key="CurcularButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <ContentPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True"/>
                            <Trigger Property="IsPressed" Value="True"/>
                            <Trigger Property="IsEnabled" Value="False"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
        <Button x:Name="CommandButton" Width="{Binding ActualWidth, ElementName=userControl, Mode=OneWay}" FontSize="29.333"  Height="{Binding ActualHeight, ElementName=userControl, Mode=OneWay}" Visibility="Visible" Background="#7FC6C8C6" BorderBrush="#7FFFFFFF" FontWeight="Bold" Foreground="#FFFFFFFF" Style="{DynamicResource CurcularButtonStyle}">
        <Button.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Button.RenderTransform>
        	<Grid Margin="6.5,0,0,6.5">
        		<Ellipse Width="45" Height="45" d:LayoutOverrides="Margin" Stroke="#558D8C8C">
        			<Ellipse.Fill>
        				<RadialGradientBrush>
        					<GradientStop Color="White" Offset="0.091"/>
        					<GradientStop Color="#FF00B3E2" Offset="0.909"/>
        				</RadialGradientBrush>
        			</Ellipse.Fill>
        		</Ellipse>
        		<Path Data="M19.389403,2.7182948 C23.595125,4.7310413 26.5,9.0262857 26.5,14 26.5,20.903559 20.903559,26.5 14,26.5 7.0964406,26.5 1.5,20.903559 1.5,14 1.5,9.0466683 4.381115,4.7662571 8.5589565,2.7431548" Stretch="Fill" Stroke="#FF3B3B3B" StrokeThickness="3" Margin="11.5,14.7,11.5,9.7" />
        		<Rectangle Height="9.562" Margin="0,11.8,0,0" Stroke="#FF3B3B3B" StrokeThickness="3" VerticalAlignment="Top" HorizontalAlignment="Center" RadiusX="3" RadiusY="2"/>
        		<Ellipse Margin="9,7.8,9,20.2">
        			<Ellipse.Fill>
        				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        					<GradientStop Color="White" Offset="0"/>
        					<GradientStop Color="#2FFFFFFF" Offset="1"/>
        				</LinearGradientBrush>
        			</Ellipse.Fill>
        		</Ellipse>
        	</Grid>
    </Button>
</UserControl>
